<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片上传成功 - 舌头状态检测系统</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .container {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 30px;
            width: 100%;
            max-width: 600px;
            text-align: center;
        }
        h1 {
            color: #333;
            margin-bottom: 20px;
        }
        .success-message {
            color: #155724;
            background-color: #d4edda;
            border-radius: 4px;
            padding: 15px;
            margin-bottom: 20px;
        }
        .image-container {
            margin: 20px 0;
        }
        .uploaded-image {
            max-width: 100%;
            max-height: 400px;
            border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        .url-container {
            margin: 20px 0;
            padding: 10px;
            background-color: #f8f9fa;
            border-radius: 4px;
            border: 1px solid #ddd;
        }
        .url-text {
            word-break: break-all;
            font-family: monospace;
            margin: 10px 0;
        }
        .button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            margin-top: 20px;
        }
        .button:hover {
            opacity: 0.9;
        }
        .copy-button {
            background-color: #6c757d;
            margin-left: 10px;
        }
        .flash-messages {
            margin-bottom: 20px;
        }
        .flash-message {
            padding: 10px;
            background-color: #d4edda;
            color: #155724;
            border-radius: 4px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>图片上传成功</h1>
        
        <div class="flash-messages">
            {% with messages = get_flashed_messages() %}
                {% if messages %}
                    {% for message in messages %}
                        <div class="flash-message">{{ message }}</div>
                    {% endfor %}
                {% endif %}
            {% endwith %}
        </div>
        
        <div class="success-message">
            您的图片已成功上传，以下是图片的访问地址。
        </div>
        
        <div class="image-container">
            <img class="uploaded-image" src="{{ file_url }}" alt="上传的图片">
        </div>
        
        <div class="url-container">
            <p>图片URL:</p>
            <p id="image-url" class="url-text">{{ file_url }}</p>
            <button class="button copy-button" onclick="copyToClipboard()">复制链接</button>
        </div>
        
        <a href="/" class="button">返回首页</a>
    </div>
    
    <script>
        function copyToClipboard() {
            const urlText = document.getElementById('image-url').textContent;
            navigator.clipboard.writeText(urlText).then(function() {
                alert('图片链接已复制到剪贴板');
            }, function(err) {
                console.error('无法复制链接: ', err);
                alert('复制失败，请手动复制链接');
            });
        }
    </script>
</body>
</html> 